import java.util.Arrays;
/**
 * Created with IntelliJ IDEA.
 * Description:
 */
public class TestDemo {
    public static void main(String[] args) {
        int a = 2;
        int b = 4;
        int[] array1 = {1,3,5,7,9};
        int[] array2 = copyOf(array1);
        System.out.println(Arrays.toString(copyOf(array2)));

    }

    public static int[] copyOf(int[] array){
        int[] ret = new int[array.length];
        for (int i = 0; i < array.length; i++) {
            ret[i] = array[i];
        }
        return ret;
    }
}
